<?php

/**
 * StaffEducationBackground form base class.
 *
 * @method StaffEducationBackground getObject() Returns the current form's model object
 *
 * @package    erp-dnict
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseStaffEducationBackgroundForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'staff_id'                => new sfWidgetFormInputHidden(),
      'education_background_id' => new sfWidgetFormInputHidden(),
      'grade'                   => new sfWidgetFormInputText(),
      'issue_date'              => new sfWidgetFormDate(),
      'issue_establishment'     => new sfWidgetFormInputText(),
      'created_at'              => new sfWidgetFormDateTime(),
      'updated_at'              => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'staff_id'                => new sfValidatorChoice(array('choices' => array($this->getObject()->get('staff_id')), 'empty_value' => $this->getObject()->get('staff_id'), 'required' => false)),
      'education_background_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('education_background_id')), 'empty_value' => $this->getObject()->get('education_background_id'), 'required' => false)),
      'grade'                   => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'issue_date'              => new sfValidatorDate(),
      'issue_establishment'     => new sfValidatorString(array('max_length' => 255)),
      'created_at'              => new sfValidatorDateTime(),
      'updated_at'              => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('staff_education_background[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'StaffEducationBackground';
  }

}
